<template>
  <div id="information">
    <!-- 修改用户名 -->
    <AltName></AltName>
     <!-- 修改密码 -->
    <AltPass></AltPass>
     <!-- 修改头像 -->
    <AltPhone></AltPhone>
  </div>
</template>
 
<script>
import AltName from "@/components/information/AltName"
import AltPass from "@/components/information/AltPass"
import AltPhone from "@/components/information/AltPhone"
import {mapState} from "vuex"
export default {
  name: 'Information',
  computed:{
    ...mapState(['userInfo'])
  },
  methods:{
  },
  components:{
    AltName,
    AltPass,
    AltPhone
  },
  beforeRouteEnter(to,from,next){
  next(vm=>{  
    if(!vm.userInfo.name){
      vm.$router.replace("/")
      vm.$message.warning("请先登录")
      return
    }
  })
}
}
</script>

<style scoped lang='less'>
#information{
  width: 500px;
  height: 100%;
  padding-left: 20px;
}
</style>